package cate.game.role.pvp.eliterace.msg;

import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.pvp.eliterace.data.EliteRaceSpec;
import easy.java.practice.errorcode.EcResult;

import static cate.game.client.msg.id.MsgIdBEliteRace.BET_REQ;

@ClientMsg(title = "竞猜 请求")
public class EliteRaceBetReq implements MsgInput {

    public EliteRaceSpec spec;

    public byte side;
    public String uid;

    @Override
    public MsgConfig conf() {
        return BET_REQ;
    }

    @Override
    public void execute(GameBody game, ClientContext cc) {
        this.uid = cc.getRole().getUid();
        EcResult<Void> r = game.pvp.eliteRace.getHandler().handleBetReq(cc.getRole(), this);
        if (!r.ok()) {
            game.notice.message(cc.getRole(), r);
        }
    }
}
